home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ MSOXP OTL Security 1.xpl < prev    next >
Text File  |  2001-05-05  |  4KB  |  144 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "UIPATH"="Program Options\Microsoft Office\MS Office XP\Outlook"
  5. "NAME"="Email Files Security"
  6. "VERSION"="1.03"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Add..."
  9. "TEXT 2"="Remove selection"
  10. "DESCRIPTION 1"="Outlook 2002 (XP) uses a very strict file type security management. This means, you can not acess some files from an email at all (so called "Level 1" files) and some can only be saved to disk but not started ("Level 2" files)."
  11. "DESCRIPTION 2"="For example, EXE files are by default Level 1 files which means you can not start them or save them. Outlook simple blocks them."
  12. "DESCRIPTION 3"="With this setting, you can "Downgrade" some of those Level 1 files (no access to all) to Level 2 files (you can save them to disk)."
  13. "DESCRIPTION 4"="Simply click "Add" and enter the extension you do not have access to (e.g. "EXE") so you can save them to disk from a email."
  14. "AUTHOR"="Xteq Systems"
  15. "CONTACTURL"="http://www.xteq.com/"
  16. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  17. "COMMENT 1"=" "
  18.  
  19.  
  20. sPCheck="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\"
  21. sV="HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security\Level1Remove"
  22.  
  23. iCount=0
  24.  
  25. Sub Plugin_Initialize 
  26. if RegPathExists(sPCheck) then
  27.    Call InitListbox
  28. else
  29.    Call Disable()
  30. end if
  31.  
  32. End Sub
  33.  
  34.  
  35.  
  36.  
  37. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  38.  if ElementIndex=1 then 'ADD
  39.     s=InputWindow("Please enter the extension to unblock, e.g. <EXE>","",1)
  40.     if IsEmpty(s)=false then
  41.        if Len(s)>0 then
  42.           iCount=iCount+1
  43.           Call SetUIElement(iCount,s)
  44.           Call WriteRegistry()
  45.           Call InitListbox()              
  46.        end if
  47.     end if
  48.  
  49.  elseif ElementIndex=2 then 'REMOVE
  50.    if ElementSubIndex=0 then
  51.       Call MsgError("Please select an extension to remove")
  52.    else
  53.       Call SetUIElement(ElementSubIndex,"")
  54.       iCount=iCount-1
  55.  
  56.       Call WriteRegistry()
  57.       Call InitListbox()
  58.    end if
  59.  end if
  60.  
  61.  
  62. ' Call Logoff()
  63. End Sub
  64.  
  65.  
  66. Sub InitListbox
  67.  for i=1 to iCount
  68.      Call SetUIElement(i,"")
  69.  next
  70.  
  71.  iCount=0
  72.  
  73.  s=RegReadValue(sV)
  74.  if IsEmpty(s)=false then
  75.     'Dim ary()
  76.     ary=Split(s,";")
  77.  
  78.     for l=lBound(ary) to ubound(ary)
  79.         s=ary(l)
  80.         s=lcase(s)
  81.         if len(s)>0 then
  82.            sDesc=GetFileDescription("." & s)
  83.  
  84.            iCount=iCount+1
  85.            Call SetUIElement(iCount,s & " (" & sDesc & ")")
  86.         end if
  87.     next
  88.  end if
  89.  
  90. end sub
  91.  
  92.  
  93. Sub WriteRegistry
  94.  s=""
  95.  for i=1 to iCount
  96.      s2=GetUIElement(i)
  97.      iPos=InStr(s2," ")
  98.      if iPos>0 then
  99.         s2=Left(s2,iPos-1)
  100.         s2=LCase(s2)
  101.      end if
  102.  
  103.      if len(s2)>0 then
  104.         s=s & UCASE(s2) & ";"
  105.      end if
  106.  next
  107.  
  108.  
  109.  Call RegWriteValue(sV,s,1)
  110. End Sub
  111.  
  112.  
  113. Sub Plugin_Terminate 
  114. End Sub
  115.  
  116.  
  117.  
  118.  
  119. 'VERSION 1.1
  120. 'returns the readable description for a file TYPE. Input is the
  121. 'raw file type (e.g. ".TXT"). 
  122. Function GetFileDescription(DotType)
  123.   sxd_BasePath="HKLM\Software\Classes\"
  124.  
  125.   sxd_Path=sxd_BasePath & DotType & "\@"
  126.   sxd_Val=RegReadValue(sxd_Path)
  127.  
  128.   if IsEmpty(sxd_Val)=true then
  129.      'extended description not found! return default
  130.      GetFileDescription="<UNKNOWN>"
  131.   else
  132.      'found, now get the "real" description
  133.      sxd_Path=sxd_BasePath & sxd_Val & "\@"
  134.      sxd_Name=RegReadValue(sxd_Path)
  135.      
  136.      if IsEmpty(sxd_Name)=true then
  137.         'argh! 
  138.         GetFileDescription="<UNKNOWN>"
  139.      else
  140.         GetFileDescription=sxd_Name
  141.      end if
  142.   end if
  143.  
  144. End Function